<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="css animation," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="css animationLearn by devtips CSS Animations Series css animation propopacityopacity是最常用的动态效果属性，通过不透明性的大小可以反应出焦点的变化以及重要性的不同 1opacity: number[0,1]; transformtransform可以改变css属性，并可以制作各种动态化的效果 12345678910">
<meta name="keywords" content="css animation">
<meta property="og:type" content="article">
<meta property="og:title" content="css-animation">
<meta property="og:url" content="https://windvans.github.io/2017/04/16/2017/css-animation/index.html">
<meta property="og:site_name" content="windvans的自留地">
<meta property="og:description" content="css animationLearn by devtips CSS Animations Series css animation propopacityopacity是最常用的动态效果属性，通过不透明性的大小可以反应出焦点的变化以及重要性的不同 1opacity: number[0,1]; transformtransform可以改变css属性，并可以制作各种动态化的效果 12345678910">
<meta property="og:updated_time" content="2017-04-18T12:02:47.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="css-animation">
<meta name="twitter:description" content="css animationLearn by devtips CSS Animations Series css animation propopacityopacity是最常用的动态效果属性，通过不透明性的大小可以反应出焦点的变化以及重要性的不同 1opacity: number[0,1]; transformtransform可以改变css属性，并可以制作各种动态化的效果 12345678910">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"right","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://windvans.github.io/2017/04/16/2017/css-animation/"/>





  <title> css-animation | windvans的自留地 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-61677410-1', 'auto');
  ga('send', 'pageview');
</script>











  
  
    
  

  <div class="container sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">windvans的自留地</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description">winvans'blog</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://windvans.github.io/2017/04/16/2017/css-animation/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="windvans">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="windvans的自留地">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">
            
            
              
                css-animation
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-16T14:26:00+08:00">
                2017-04-16
              </time>
            

            
              <span class="post-meta-divider">|</span>
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-check-o"></i>
              </span>
              
                <span class="post-meta-item-text">更新于</span>
              
              <time title="更新于" itemprop="dateModified" datetime="2017-04-18T20:02:47+08:00">
                2017-04-18
              </time>
            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/css/" itemprop="url" rel="index">
                    <span itemprop="name">css</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/04/16/2017/css-animation/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count"
                        data-disqus-identifier="2017/04/16/2017/css-animation/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="css-animation"><a href="#css-animation" class="headerlink" title="css animation"></a>css animation</h1><p>Learn by <a href="https://www.youtube.com/playlist?list=PLqGj3iMvMa4LvJ8VctoXnPI0dtE40wfid" target="_blank" rel="external">devtips</a></p>
<p>CSS Animations Series</p>
<h1 id="css-animation-prop"><a href="#css-animation-prop" class="headerlink" title="css animation prop"></a>css animation prop</h1><h2 id="opacity"><a href="#opacity" class="headerlink" title="opacity"></a>opacity</h2><p>opacity是最常用的动态效果属性，通过不透明性的大小可以反应出焦点的变化以及重要性的不同</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="selector-tag">opacity</span>: <span class="selector-tag">number</span><span class="selector-attr">[0,1]</span>;</div></pre></td></tr></table></figure>
<h2 id="transform"><a href="#transform" class="headerlink" title="transform"></a>transform</h2><p>transform可以改变css属性，并可以制作各种动态化的效果</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/* Function values */</span></div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">matrix</span>(1<span class="selector-class">.0</span>, 2<span class="selector-class">.0</span>, 3<span class="selector-class">.0</span>, 4<span class="selector-class">.0</span>, 5<span class="selector-class">.0</span>, 6<span class="selector-class">.0</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">translate</span>(12<span class="selector-tag">px</span>, 50%);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">translateX</span>(2<span class="selector-tag">em</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">translateY</span>(3<span class="selector-tag">in</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">scale</span>(2, 0<span class="selector-class">.5</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">scaleX</span>(2);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">scaleY</span>(0<span class="selector-class">.5</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">rotate</span>(0<span class="selector-class">.5turn</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">skew</span>(30<span class="selector-tag">deg</span>, 20<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">skewX</span>(30<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">skewY</span>(1<span class="selector-class">.07rad</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">matrix3d</span>(1<span class="selector-class">.0</span>, 2<span class="selector-class">.0</span>, 3<span class="selector-class">.0</span>, 4<span class="selector-class">.0</span>, 5<span class="selector-class">.0</span>, 6<span class="selector-class">.0</span>, 7<span class="selector-class">.0</span>, 8<span class="selector-class">.0</span>, 9<span class="selector-class">.0</span>, 10<span class="selector-class">.0</span>, 11<span class="selector-class">.0</span>, 12<span class="selector-class">.0</span>, 13<span class="selector-class">.0</span>, 14<span class="selector-class">.0</span>, 15<span class="selector-class">.0</span>, 16<span class="selector-class">.0</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">translate3d</span>(12<span class="selector-tag">px</span>, 50%, 3<span class="selector-tag">em</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">translateZ</span>(2<span class="selector-tag">px</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">scale3d</span>(2<span class="selector-class">.5</span>, 1<span class="selector-class">.2</span>, 0<span class="selector-class">.3</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">scaleZ</span>(0<span class="selector-class">.3</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">rotate3d</span>(1, 2<span class="selector-class">.0</span>, 3<span class="selector-class">.0</span>, 10<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">rotateX</span>(10<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">rotateY</span>(10<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">rotateZ</span>(10<span class="selector-tag">deg</span>);</div><div class="line"><span class="selector-tag">transform</span>: <span class="selector-tag">perspective</span>(17<span class="selector-tag">px</span>);</div></pre></td></tr></table></figure>
      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <ul class="post-copyright">
    <li class="post-copyright-author">
      <strong>本文作者：</strong>
      windvans
    </li>
    <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://windvans.github.io/2017/04/16/2017/css-animation/" title="css-animation">https://windvans.github.io/2017/04/16/2017/css-animation/</a>
    </li>
    <li class="post-copyright-license">
      <strong>版权声明： </strong>
      本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
    </li>
  </ul>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/css-animation/" rel="tag"># css animation</a>
          
        </div>
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/04/30/2017/《第一夫人》读后感/" rel="next" title="《第一夫人》读后感">
                <i class="fa fa-chevron-left"></i> 《第一夫人》读后感
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/03/28/2017/gulpfile.js & webpack.config.js/" rel="prev" title="gulpfile.js & webpack.config.js">
                gulpfile.js & webpack.config.js <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="windvans" />
          <p class="site-author-name" itemprop="name">windvans</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
           
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">24</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              
                <span class="site-state-item-count">7</span>
                <span class="site-state-item-name">分类</span>
              
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              
                <span class="site-state-item-count">15</span>
                <span class="site-state-item-name">标签</span>
              
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#css-animation"><span class="nav-number">1.</span> <span class="nav-text">css animation</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#css-animation-prop"><span class="nav-number">2.</span> <span class="nav-text">css animation prop</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#opacity"><span class="nav-number">2.1.</span> <span class="nav-text">opacity</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#transform"><span class="nav-number">2.2.</span> <span class="nav-text">transform</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">windvans</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  






  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  


  

    
      <script id="dsq-count-scr" src="https://windvans.disqus.com/count.js" async></script>
    

    
      <script type="text/javascript">
        var disqus_config = function () {
          this.page.url = 'https://windvans.github.io/2017/04/16/2017/css-animation/';
          this.page.identifier = '2017/04/16/2017/css-animation/';
          this.page.title = 'css-animation';
        };
        var d = document, s = d.createElement('script');
        s.src = 'https://windvans.disqus.com/embed.js';
        s.setAttribute('data-timestamp', '' + +new Date());
        (d.head || d.body).appendChild(s);
      </script>
    

  




	





  





  





  






  





  

  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

</body>
</html>
